import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
    history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
routes: [
    {
        path: '/',
        redirect: '/home'
    },
    {
        path:"/login",
        name:'login',
        component: () => import('../views/login.vue'),
    },
    {
        path: "/home",
        name: "home",
        component: () => import("../views/home.vue"),
    },
    {
        path: "/favor",
        name: "favor",
        component: () => import("../views/course.vue"),
    },
    {
        path: "/order",
        name: "order",
        component: () => import("../views/mall.vue"),
    },
    {
        path: "/message",
        name: "message",
        component: () => import("../views/message.vue")
    },
    {
        path: "/goodsDetail/:id",
        name: "goodsDetail",
        component: () => import("../views/goodsDetail.vue")
    },
    {
        path: "/newsList",
        name: "newsList",
        component: () => import("../views/NewsList.vue")
    },
    {
        path: "/newsDetail/:id",
        name: "newsDetail",
        component: () => import("../views/NewsDetail.vue")
    },
]
})
export default router;